<form class="form-inline">
    <?php echo html_select_render(post_month_all(), '全部日期', array(
        'name' => 'm',
        'selected' => get('m'),
    )) ?>
    <?php echo html_select_render(category_all(), '所有分类', array(
        'name' => 'cid',
        'selected' => get('cid'),
    )) ?>
    <div class="form-group">
        <label for="s">搜索标题：</label><input type="text" class="form-control" name="s" value="<?php e(get('s')); ?>">
    </div>
    <input type="submit" class="btn btn-primary" value="确定">
    <a href="post.php" class="btn btn-primary">重置</a>
</form>
<table class="table table-striped">
    <thead>
    <tr>
        <th>ID</th>
        <th>标题</th>
        <th>作者</th>
        <th>分类目录</th>
        <th>标签</th>
        <th>评论</th>
        <th>日期</th>
        <th>操作</th>
    </tr>
    </thead>
    <?php foreach ($data['items'] as $post): ?>
        <tr>
            <td><?php echo $post['id']; ?></td>
            <td><?php e($post['post_title']) ?></td>
            <td><?php e($users[$post['post_author_id']]['username']); ?></td>
            <td><a href="?cid=<?php echo $post['category_id']; ?>"><?php e($category_name_map[$post['category_id']]); ?></a></td>
            <td><?php echo $post['tag']; ?></td>
            <td><?php echo $post['comment']; ?></td>
            <td><?php echo $post['post_date']; ?></td>
            <td>
                <a href="?action=edit&id=<?php echo $post['id']; ?>"><span class="glyphicon glyphicon-edit"></span>编辑</a>
                <a href="?action=delete&id=<?php echo $post['id']; ?>" data-confirm="确定删除?" class="cmd-post"><span class="glyphicon glyphicon-remove"></span>删除</a>
            </td>
        </tr>
    <?php endforeach; ?>
</table>

<?php echo $data['pagination']['html']; ?>